{include file="Public:header"/}

	<link rel="stylesheet" href="/static/style/login.css" type="text/css">

	<script src="/static/js/jquery-1.7.2.js" type="text/javascript"></script>
	<script src="/static/js/jquery.validate.min.js" type="text/javascript"></script>
        <script src="/static/js/messages_zh.min.js" type="text/javascript"></script>
       <style>
	    .error{
                color:red;
            }
            .txt{
                float: left;
            }
            
	</style>
     
	<div style="clear:both;"></div>

	<!-- 页面头部 start -->
	<div class="header w990 bc mt15">
		<div class="logo w990">
			<h2 class="fl"><a href="{:url('/home/index/index')}"><img src="/static/images/logo.png" alt="京西商城"></a></h2>
		</div>
	</div>
	<!-- 页面头部 end -->
	
	<!-- 登录主体部分start -->
	<div class="login w990 bc mt10 regist">
		<div class="login_hd">
			<h2>用户注册</h2>
			<b></b>
		</div>
		<div class="login_bd">
			<div class="login_form fl">
				<form id='commentForm' action="{:url('home/user/register')}" method="post">
					<ul>
						<li>
							<label for="">用户名：</label>
							<input type="text" class="txt" name="name" id='cname'/>
                                                      <br><br><p>3-20位字符，可由中文、字母、数字和下划线组成</p>
						</li>
						<li>
							<label for="">密码：</label>
							<input type="password" class="txt" name="password" id='password'/>
							<br><br><p>6-20位字符，可使用字母、数字和符号的组合，不建议使用纯数字、纯字母、纯符号</p>
						</li>
						<li>
							<label for="">确认密码：</label>
							<input type="password" class="txt" name="repassword" id='repassword'/>
							<br><br><p> <span>请再次输入密码</p>
						</li>
						<li class="checkcode">
							<label for="">验证码：</label>
							<input type="text" class="txt" name="verify" id="verify" />
							<img style="float:left" id='captcha' src="{:captcha_src()}"alt="captcha"  />
							<span style="float:left">看不清？<a href="javascript:fn()">换一张</a></span>
                                                        <label id="verify-error" class="error" for="verify"></label> <!-- 错误位置 -->
						</li>
                                                <li></li><li></li>
						<li>
							<label for="">&nbsp;</label>
							<input type="checkbox" class="chb" checked="checked" /> 我已阅读并同意《用户注册协议》
						</li>
						<li>
							<label for="">&nbsp;</label>
							<input type="submit" value="" class="login_btn" />
						</li>
					</ul>
				</form>

				
			</div>
			
			<div class="mobile fl">
				<h3>手机快速注册</h3>			
				<p>中国大陆手机用户，编辑短信 “<strong>XX</strong>”发送到：</p>
				<p><strong>1069099988</strong></p>
			</div>

		</div>
	</div>
	<!-- 登录主体部分end -->

	<div style="clear:both;"></div>
	<!-- 底部版权 start -->
	<div class="footer w1210 bc mt15">
		<p class="links">
			<a href="">关于我们</a> |
			<a href="">联系我们</a> |
			<a href="">人才招聘</a> |
			<a href="">商家入驻</a> |
			<a href="">千寻网</a> |
			<a href="">奢侈品网</a> |
			<a href="">广告服务</a> |
			<a href="">移动终端</a> |
			<a href="">友情链接</a> |
			<a href="">销售联盟</a> |
			<a href="">京西论坛</a>
		</p>
		<p class="copyright">
			 © 2005-2013 京东网上商城 版权所有，并保留所有权利。  ICP备案证书号:京ICP证070359号 
		</p>
		<p class="auth">
			<a href=""><img src="/static/images/xin.png" alt="" /></a>
			<a href=""><img src="/static/images/kexin.jpg" alt="" /></a>
			<a href=""><img src="/static/images/police.jpg" alt="" /></a>
			<a href=""><img src="/static/images/beian.gif" alt="" /></a>
		</p>
	</div>
	<!-- 底部版权 end -->
<script>
    function fn(){
        document.getElementById('captcha').src+='?';
    }
       
        //刷新验证码
//         function verify(){
//             $("#cverify").attr("src","{:captcha_src()}"+"?"+Math.random());
//         }
         
         //表单验证
	  $("#commentForm").validate({
		rules: {   //校验规则	 
                    name:{    //form的name属性
                            required: true,
                            minlength: 2,
                            remote:{  //后台验证  ajax
                                url: "{:url('home/User/doregister')}",
                                type:'post',//提交方式
                                data:{  //传输数据  $_POST['username']
                                    name:function(){
                                        return $("#cname").val();
                                    }
                                }
                            } 
                        },
                    verify:{    //form的verify属性
                            required: true,
                            remote:{  //后台验证  ajax
                                url: "{:url('home/User/checkCode')}",
                                type:'post',//提交方式
                                data:{  //传输数据  $_POST['verify']
                                    name:function(){
                                        return $("#captcha").val();
                                    }
                                }
                            } 
                        },    
                    password: {
                        required: true,
                        minlength: 6
                    },
                    repassword: {
                        required: true,
                        minlength: 6,
                        equalTo: "#password"
                    },
		},
		messages: {  //提示信息
		    name: {
			required:"请输入用户名",
                        minlength:"长度不够",
			remote:"用户名已存在"
		    },
		    password: {
			required: "请输入密码",
			minlength: "密码长度最少6位"
		    },
		    repassword: {
			required: "请输入确认密码",
                        minlength: "密码长度最少6位",
			equalTo: "密码不一致"
		    },
                    verify: {
			required:"请输入验证码",
			remote:"验证码错误"
		    }
		   
		}
	    });
		

	   
</script>
</body>
</html>